// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import store from './store/store'
import $ from 'jquery'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './lib/bootstrap/dist/css/bootstrap.min.css'
import router from './router'
import './css/common.css'
import './js/common.js'

import './js/filter.js'
import  WebUploader from 'webuploader';
import browserMD5File  from 'browser-md5-file'
import VueResource from 'vue-resource'
import cookie from './js/cookie'
window.browserMD5File = browserMD5File;
window.WebUploader = WebUploader

Vue.use(ElementUI)
Vue.use(VueResource)
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',
})

Vue.http.interceptors.push((request,next)=>{
  var _this = this;
  next((response)=>{
    console.log("拦截器response",response);
    if(response.status==401){
      cookie.setCookie("userInfo","",-1);
      console.log("拦截器")
      router.replace({path:'login'})
      return response
    }
  });
})
